/**
 * Created by fanyongsheng on 2017/3/28.
 */
(function(){
    /**
     * 登录大厅模块
     */
    var App = new Vue({
        el: "#prepare-for-business",
        data: {
            show_modual: 'login', //'login', 'hall'
            username: 'admin',
            password: '123',
            code:'',
            userInput: 0,
            pwdInput: 0,
            codeInput: 0,
            rememberPwd: false,
            log_lists:[],
            currentpage: 1,
            totlepage: 0,
            visiblepage: 10,
            start_date:'',
            end_date:'',
            log_status:'',
            product_name_log:'',
            no_content_logList:false,
            init_log:true
        },
        mounted: function () {
            $(".username_").focus();
        },
        methods: {
            "dealLogin": function () {
                var _this = this;
                if (!this.username || !this.password) {
                    if (!this.username) {
                        this.userInput = 1;
                    }
                    if (!this.password) {
                        this.pwdInput = 1;
                    }
                    if(!this.code){
                        this.codeInput=1;
                    }
                    return;
                }

                layerIndex = layer.msg('正在进入营业厅，请稍等...', {
                    icon: 16
                    ,shade: 0.3,
                    time:10000000
                });
                login_anychat(_this.username);
                this.show_modual = 'hall';

                $("#Header_And_Footer").removeClass("hide");
            }
        }
    });
    
    
    $(".status-btn").on("mouseover",function(){
        $(".status-menu-box").removeClass("dn");
    });
    $(".status-menu-box").on("mouseleave",function(){
        $(this).addClass("dn");
    });
    $(".status-menu-box li").on("click",function(){
        var i = $(this).index();
        $(".status-box i:eq("+i+")").removeClass("dn").siblings().addClass("dn");
        $(".status-menu-box").addClass("dn");
    });
    $(document).on('click', '.AnyChatSignout', function(){
        RemoteDouble.hideVideo();
        layer.confirm('您是否确认退出？', {
            btn: ['确认','取消']
        }, function(){
            BRAC_Logout();
            location.reload(true);
        }, function(){
            RemoteDouble.showVideo();
        });
    });
    //window.onbeforeunload = BRAC_Logout
})();